﻿<Window x:Class="Control_DB_Railway.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Control_DB_Railway"
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        Title="Интерфейс для ведения информационной базы 'Железная дорога'" 
        Height="500" 
        Width="600">

    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Button Background="WhiteSmoke"
                HorizontalAlignment="Right"
                BorderBrush="Black"
                Grid.Row="0"
                Content="Выйти" 
                Margin="0,5,5,5"
                Width="157"
                Click="Button_Click"/>

        <!--Вкладки-->
        <TabControl Grid.Row="1">

            <!--Вкладка "Станции"-->
            <TabItem Name="StationsTab">

                <!--Заголовок вкладки "Станции"-->
                <TabItem.Header>
                    <TextBlock Text=" Станции "/>
                </TabItem.Header>

                <!--Сетка для вкладки "Станция"-->
                <Grid>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="250"/>
                    </Grid.RowDefinitions>

                    <!--Отображение данных из сущности "Станции"-->
                    <ListBox Name="listBox_Station"
                             Grid.Row="1"
                             BorderBrush="Black"
                             BorderThickness="2"
                             Background="WhiteSmoke" 
                             SelectionChanged="listBox_Station_SelectionChanged"/>

                    <!--GroupBox с кнопками-->
                    <GroupBox Grid.Row="2"
                              Header="Кнопки вызова"
                              FontSize="15"
                              Width="250"
                              Height="180"
                              HorizontalAlignment="Right"
                              Margin="0 0 40 0"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>


                            <Button Name="button_AddRecord_Station"
                                    Content="Добавить/Изменить станцию"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    Click="button_AddRecord_Station_Click" 
                                    Width="218"/>

                            <Button Name="button_DeleteRecord_Station"
                                    Content="Удалить станцию" 
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    Grid.Row="1" 
                                    Click="button_DeleteRecord_Station_Click" 
                                    Width="218"/>

                            <Button x:Name="button_ClearStation"
                                    Content="Очистить" 
                                    HorizontalAlignment="Center"
                                    Grid.Row="2" 
                                    VerticalAlignment="Center" 
                                    Width="218" 
                                    Click="button_ClearStation_Click"/>
                        </Grid>

                    </GroupBox>

                    <!--GroupBox с элементами ввода-->
                    <GroupBox Grid.Row="2"
                              Header="Элементы ввода"
                              FontSize="15"
                              Width="230"
                              Height="220"
                              HorizontalAlignment="Left"
                              Margin="30 0 0 0"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>

                            <TextBlock HorizontalAlignment="Left" 
                                       Margin="20 5 0 0" 
                                       Grid.Row="0" 
                                       Text="Название:" 
                                       VerticalAlignment="Top"/>

                            <TextBox Name="textBox_Station"
                                     HorizontalAlignment="Center" 
                                     VerticalAlignment="Top" 
                                     Margin="0,25,0,0" 
                                     Grid.Row="0" 
                                     Background="WhiteSmoke"
                                     Width="179"/>

                            <CheckBox Name="checkBox_overheadTransition"
                                      Margin="20 5 0 0"
                                      Content="Надземный переход" 
                                      HorizontalAlignment="Left" 
                                      VerticalAlignment="Center"
                                      Grid.Row="1" />

                            <TextBlock HorizontalAlignment="Left"
                                       Margin="20 5 0 0"
                                       Grid.Row="2" 
                                       Text="Местоположение:" 
                                       VerticalAlignment="Top"/>

                            <TextBox Name="textBox_Location"
                                     Margin="0,25,0,0"
                                     HorizontalAlignment="Center" 
                                     Grid.Row="2" 
                                     Background="WhiteSmoke"
                                     VerticalAlignment="Top" 
                                     Width="178"/>

                            <TextBlock HorizontalAlignment="Left"
                                       Margin="20 5 0 0"
                                       Grid.Row="3" 
                                       Text="Тип станции:" 
                                       VerticalAlignment="Top" 
                                       Height="17"/>

                            <ComboBox x:Name="comboBox_TypeStation"
                                      Margin="0,25,0,0"
                                      HorizontalAlignment="Center" 
                                      Grid.Row="3" 
                                      VerticalAlignment="Top" 
                                      Width="178"/>

                        </Grid>

                    </GroupBox>


                    <!--Поиск-->
                    <TextBox Name="textBox_Search_Stations"
                             Grid.Row="0"   
                             HorizontalAlignment="Right"
                             Margin="0,0,40,0" 
                             Background="WhiteSmoke" 
                             VerticalAlignment="Center" 
                             Height="18"
                             Width="120"/>

                    <Button Name="buttonSearch_Stations"
                            Content="Искать" 
                            HorizontalAlignment="Right" 
                            Margin="0 0 0 0"
                            Grid.Row="0"
                            VerticalAlignment="Center" 
                            FontSize="10"
                            Height="18" 
                            Click="buttonSearch_Stations_Click"/>
                    
                    <!--Кнопка открытия таблицы DataGrid_Station-->
                    <Label Content="Открыть DataGrid Stations:"
                           Grid.Row="2"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Top"
                           Margin="0 2 25 0"/>

                    <Button Name="button_OpenDisplayData"
                            Grid.Row="2"
                            Content="..."
                            HorizontalAlignment="Right"
                            VerticalAlignment="Top"
                            Height="20"
                            Width="20"
                            Margin="0 5 5 0" 
                            Click="button_OpenDisplayData_Click"/>

                </Grid>

            </TabItem>

            <!--Вкладка "Тип станции"-->
            <TabItem Name="TypeStationsTab">

                <!--Заголовок вкладки "Тип станции"-->
                <TabItem.Header>
                    <TextBlock Text=" Тип станции "/>
                </TabItem.Header>

                <Grid>

                    <!--Сетка для вкладки "Тип станции"-->
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="250"/>
                    </Grid.RowDefinitions>


                    <!--Отображение данных из сущности "Тип станции"-->
                    <ListBox Name="listBox_TypeStation"
                             Grid.Row="1"
                             BorderBrush="Black"
                             BorderThickness="2"
                             Background="WhiteSmoke" 
                             SelectionChanged="listBox_TypeStation_SelectionChanged"/>

                    <!--GroupBox с кнопками-->
                    <GroupBox Grid.Row="2"
                              Header="Кнопки вызова"
                              FontSize="15"
                              Width="260"
                              Height="180"
                              HorizontalAlignment="Right"
                              Margin="0 0 20 0"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>

                            <Button Name="button_AddRecord_TypeStation"
                                    Content="Добавить/изменить тип станции" 
                                    HorizontalAlignment="Center" 
                                    VerticalAlignment="Center" 
                                    Width="228" 
                                    Click="button_AddRecord_TypeStation_Click"/>

                            <Button Name="button_DeleteRecord_TypeStation"
                                    Content="Удалить тип станции" 
                                    HorizontalAlignment="Center" 
                                    Grid.Row="1" 
                                    VerticalAlignment="Center" 
                                    Width="228" 
                                    Click="button_DeleteRecord_TypeStation_Click"/>

                            <Button x:Name="button_ClearTypeStation"
                                    Content="Очистить" 
                                    HorizontalAlignment="Center" 
                                    Grid.Row="2" 
                                    VerticalAlignment="Center" 
                                    Width="228"
                                    Click="button_ClearTypeStation_Click"/>

                        </Grid>

                    </GroupBox>

                    <!--GroupBox с элементами ввода-->
                    <GroupBox Grid.Row="2"
                              Header="Элементы ввода"
                              FontSize="15"
                              Width="250"
                              Height="120"
                              HorizontalAlignment="Left"
                              Margin="30,50,0,50"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <TextBlock HorizontalAlignment="Left" 
                                       Grid.Row="0"
                                       Margin="25 5 0 0"
                                       Text="Название:" 
                                       VerticalAlignment="Top"/>

                            <TextBox Name="textBox_TypeStation"
                                     HorizontalAlignment="Center" 
                                     Grid.Row="0"
                                     Margin="0,25,0,0"
                                     Background="WhiteSmoke"
                                     VerticalAlignment="Top" 
                                     Width="188"/>

                            <CheckBox Name="checkBox_passagerService"
                                      Content="Обслуж. пассажиров" 
                                      HorizontalAlignment="Left" 
                                      Margin="25,5,0,0" 
                                      Grid.Row="1" 
                                      VerticalAlignment="Center"/>

                        </Grid>

                    </GroupBox>

                    <!--Поиск-->
                    <TextBox Name="textBox_Search_TypeStations"
                             Grid.Row="0"   
                             HorizontalAlignment="Right"
                             Margin="0,0,40,0" 
                             Background="WhiteSmoke" 
                             VerticalAlignment="Center" 
                             Height="18"
                             Width="120"/>

                    <Button Name="buttonSearch_TypeStations"
                            Content="Искать" 
                            HorizontalAlignment="Right" 
                            Margin="0 0 0 0"
                            Grid.Row="0"
                            VerticalAlignment="Center" 
                            FontSize="10"
                            Height="18"
                            Click="buttonSearch_TypeStation_Click"/>

                </Grid>

            </TabItem>


            <!--Вкладка "Дороги"-->
            <TabItem Name="RoadsTab">

                <!--Заголовок вкладки "Дорога"-->
                <TabItem.Header>
                    <TextBlock Text="Дорога"/>
                </TabItem.Header>

                <Grid>

                    <!--Сетка для вкладки "Дорога"-->
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="250"/>
                    </Grid.RowDefinitions>

                    <!--Отображение данных из сущности "Дорога"-->
                    <ListBox Name="listBox_Road"
                             Grid.Row="1"
                             BorderBrush="Black"
                             BorderThickness="2"
                             Background="WhiteSmoke" 
                             SelectionChanged="listBox_Road_SelectionChanged">

                    </ListBox>

                    <!--GroupBox с кнопками-->
                    <GroupBox Grid.Row="2"
                              Header="Кнопки вызова"
                              FontSize="15"
                              Width="250"
                              Height="180"
                              HorizontalAlignment="Right"
                              Margin="0 0 40 0"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                                <RowDefinition Height="50"/>
                            </Grid.RowDefinitions>

                            <!--Кнопки-->
                            <Button Name="button_AddRecord_Road"
                                    Content="Добавить/Изменить дорогу"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    Width="218"
                                    Click="button_AddRecord_Road_Click"/>


                            <Button Name="button_DeleteRecord_Road"
                                    Content="Удалить дорогу" 
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    Grid.Row="1"
                                    Width="218"
                                    Click="button_DeleteRecord_Road_Click"/>

                            <Button x:Name="button_ClearRoad"
                                    Content="Очистить" 
                                    HorizontalAlignment="Center"
                                    Grid.Row="2" 
                                    VerticalAlignment="Center" 
                                    Width="218" 
                                    Click="button_ClearRoad_Click"/>

                        </Grid>

                    </GroupBox>


                    <!--GroupBox с элементами ввода-->
                    <GroupBox Grid.Row="2"
                              Header="Элементы ввода"
                              FontSize="15"
                              Width="230"
                              Height="210"
                              HorizontalAlignment="Left"
                              Margin="30 0 0 0"
                              BorderThickness="2"
                              BorderBrush="Black">

                        <Grid>

                            <!--Сетка для GroupBox-->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <TextBlock HorizontalAlignment="Left" 
                                       Margin="20 5 0 0"
                                       Grid.Row="0" 
                                       Text="Название:" 
                                       VerticalAlignment="Top"/>

                            <TextBox Name="textBox_NameRoad"
                                     HorizontalAlignment="Center" 
                                     VerticalAlignment="Top" 
                                     Margin="0,25,0,0" 
                                     Grid.Row="0" 
                                     Background="WhiteSmoke"
                                     Width="179"/>

                            <TextBlock HorizontalAlignment="Left" 
                                       Margin="20 5 0 0"
                                       Grid.Row="1"
                                       Text="Тип:" 
                                       VerticalAlignment="Top"/>

                            <TextBox Name="textBox_TypeRoad"
                                     HorizontalAlignment="Center" 
                                     VerticalAlignment="Top" 
                                     Margin="0,25,0,0" 
                                     Grid.Row="1" 
                                     Background="WhiteSmoke"
                                     Width="179"/>

                            <TextBlock HorizontalAlignment="Left" 
                                       Margin="20 5 0 0"
                                       Grid.Row="2"
                                       Text="Категория качества:" 
                                       VerticalAlignment="Top"/>

                            <TextBox x:Name="textBox_CategoryQuality"
                             HorizontalAlignment="Center" 
                                     VerticalAlignment="Top" 
                                     Margin="0,25,0,0" 
                                     Grid.Row="2" 
                                     Background="WhiteSmoke"
                                     Width="179"/>

                        </Grid>

                    </GroupBox>

                    <!--Поиск-->
                    <TextBox Name="textBox_Search_Road"
                             Grid.Row="0"   
                             HorizontalAlignment="Right"
                             Margin="0,0,40,0" 
                             Background="WhiteSmoke" 
                             VerticalAlignment="Center" 
                             Height="18"
                             Width="120"/>

                    <Button Name="buttonSearch_Road"
                            Content="Искать" 
                            HorizontalAlignment="Right" 
                            Margin="0 0 0 0"
                            Grid.Row="0"
                            VerticalAlignment="Center" 
                            FontSize="10"
                            Height="18" 
                            Click="buttonSearch_Road_Click"/>

                </Grid>

            </TabItem>

        </TabControl>

    </Grid>

</Window>